package day12.tarena.com.cllection;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Example_1 {
	public static void main(String[] args) {
		System.out.println("请输入全班同学的姓名");
		Scanner sca = new Scanner(System.in);
		List all = new ArrayList();
		while (true) { // 也是死循环
			String name = sca.next();
			if ("over".equals(name))
				break;
			all.add(name);
			// System.out.println(all.size());
		}
		System.out.println(all);
		for (int i = 0; i < all.size(); i++) {
			Object obj = all.get(i);
			if (obj instanceof String) {
				String n = (String) obj;
				if (n.toLowerCase().indexOf("a") != -1) {
					System.out.println(n);
				}
			}
		}
	}// java代码，理清思路后，调用相应的方法。
}
